<?php 
	session_start();
	if (isset($_SESSION['username']) && isset($_SESSION['uid'])) {
		require('../../Controller/MaintainSystem_controller.php');
		$admin = new MaintainSystem();
		$account = $_SESSION['username'];
		$uid = $_SESSION['uid'];
		if($admin->checkUser($account, $uid)) {
			
			$userid = $_GET['id'];
			$userInfo = $admin->getUserInfo($userid);
		}else {
			header("location:../../login.php");
		}	
	}else {
		header("location:../../login.php");
	}
?>
<html>

<head>
	<meta http-equiv="Content-Type" content="width=device-width; text-html; charset=utf-8" />
	<script type="text/javascript" src="../../CSS/bootstrap/js/jquery.js"></script>
    <script type="text/javascript" src="../../CSS/bootstrap/js/bootstrap.min.js"></script>	
	<link href="../../CSS/bootstrap/css/bootstrap.css" rel="stylesheet" />
	    <link rel="stylesheet" href="../CSS/bootstrap/css/font-awesome.css">	    
	<title>FaceTech</title>	        
	<style>
      body {
        padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */
      }
    </style>
    <link href="../../CSS/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
	<style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
      .sidebar-nav {
        padding: 9px 0;
      }
      .media, .media-body {
    		overflow:hidden;
    		*overflow:visible;
    		zoom:1;
    	}
    	.media {
    		margin-bottom: 10px;
    	}
    	.media .media {
    		margin-top: 20px;
    	}
    	.media .pull-left {
    		margin-right: 10px;
    	}
    	.media .pull-right {
    		margin-left: 10px;
    	}
    	.media .media-object {
    		display: block;
    	}
    	/* Media list */
    	.medias {
    		margin-top: 20px;
    		margin-left: 0;
    		list-style-type: none;
    	}
    	.medias .media {
    		padding-bottom: 10px;
    		border-bottom: 1px solid rgba(0,0,0,.07);
    	}
    	.medias > .media:last-child {
    		margin: 0;
    		border-bottom: none;
    	}
    	.medias > .media .media {
    		margin-bottom: 0;
    		padding-bottom: 0;
    		border-bottom: none;
    	} 
    	/* Media box */
    	.media-box {
    		margin-bottom: 10px;
    		padding: 10px;
    		background-color: #fff;
    		border: 1px solid rgba(0,0,0,.09);
    		-webkit-border-radius: 4px;
    		-moz-border-radius: 4px;
    		border-radius: 4px;
    		-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    		-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    		box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    	}
    	@media (max-width: 480px) {
    	    .media .pull-left,
    	    .media .pull-right  {
    	    	float: none;
    	    	display: block;
    	    	margin-bottom: 10px;
    	    }
    	    .media .pull-left {
    	        margin-right: 0;    
    	    }
    	    .media .pull-right {
    	        margin-left: 0;    
    	    }
    	}
    </style>
    <link href="../../CSS/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
	<link href="../../CSS/bootstrap/css/bbootstrap.min.css" rel="stylesheet" media="screen">
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->    
    <script language="javascript">
		function show(did){
			var xx=document.getElementById(did).style.display;
			if(xx==""){
				document.getElementById(did).style.display="none";
			}else{
				document.getElementById(did).style.display="";
			}
		}
	</script>
</head>
<body>
<div class="container">
							  <div style="margin-bottom: 18px;">
      						<!-- Main hero unit for a primary marketing message or call to action -->
      						<div class="hero-unit">
      							<a href="UserInfo.php" type="button" class="close">×</a>
      							<h2>修改個人資料：</h2>
      							<form action="./ModifyUser.php" method="post" enctype="multipart/form-data" name="edituserForm">
      								<input type="hidden" value=<?php echo $userInfo[0]; ?> name="id">
      								<input type="hidden" value="0" name="op">
	        						姓名 : <input type="text" class="input-block-level" value=<?php echo $userInfo[3]; ?> name="name" onClick="this.select()">
		    						生日 : <input type="text" class="input-block-level" value=<?php echo $userInfo[5]; ?> name="birth" onClick="this.select()" maxlength="10">
		   							電話 : <input type="text" class="input-block-level" value=<?php echo $userInfo[6]; ?> name="tel" onClick="this.select()" maxlength="10">
		   							<input class="btn btn-large btn-primary" type="submit" value="修改" onClick="if(confirm('您確定要送出嗎?')) return true; return false">
	        						<button class="btn btn-large btn-primary" type="reset">重設</button>
	        						
      							</form>
      							
      						
      							<div class="row-fluid">
      								<div class="span12">
      									<div class="progress">
  											<div class="bar" style="width: 100%;"></div>
										</div>
										<form action="./ModifyUserPic.php" method="post" enctype="multipart/form-data" name="thisform">
      										<input type="hidden" value="<?php echo $userInfo[0]; ?>" name="id">
      											<img class="pull-left media-object" src="../../<?php echo $userInfo[4]; ?>" height="64" width="64" border="1"/>
      											<h2>更改大頭貼：</h2>
	        									※上傳檔案大小以 <font color=red><?php echo 4194304/1024/1024; ?></font> MB 為限<br>
		   										<table ><tr><td>
		    									<table class="table table-striped table-bordered table-condensed">
				      							<tr>
				        							<td> 選擇檔案 </td>
				        							<td> <input type="file" name="upfile" class="input-file" size="20" /></td>
				      							</tr>
				    							</table></td></tr></table>
		    									<input class="btn btn-large btn-primary" type="submit" value="上傳" onClick="if(confirm('您確定要上傳嗎?')) return true; return false">
	        									<button class="btn btn-large btn-primary" type="reset">重設</button>
      									</form>
      								</div>
      							</div>	
      							
      							
      						</div>
				      	</div>
</div>										              		
	
</body>
</html>